/*
 * FeatureLine.h
 *
 *  Created on: May 4, 2009
 *      Author: wrice
 */

#ifndef FEATURELINE_H_
#define FEATURELINE_H_
#include "MyVideoTrace.h"
namespace MyVideoTrace {

class FeatureLine {
public:
	FeatureLine( FeaturePoint * lineFrom, FeaturePoint * lineTo);

	FeaturePoint * getLineFrom() const;
	FeaturePoint * getLineTo() const;

	class Comparator {
	public:
		inline bool operator() ( const FeatureLine & lhs, const FeatureLine & rhs ) const {
			return std::min( lhs.getLineFrom() , lhs.getLineTo() ) < std::min( rhs.getLineFrom(), rhs.getLineTo() )
				|| std::max( lhs.getLineFrom() , lhs.getLineTo() ) < std::max( rhs.getLineFrom(), rhs.getLineTo() );
		}
	};

public:
	static bool isTriangle( FeatureLine line1, FeatureLine line2, FeatureLine line3 );
	static FeaturePoint * getSharedPoint( FeatureLine line1, FeatureLine line2 );

private:
	FeaturePoint * lineFrom_;
	FeaturePoint * lineTo_;

public: virtual ~FeatureLine() {}
};

}
#endif /* FEATURELINE_H_ */
